This generic method produces a property value from an XElement
's attribute value, using a conversion function to convert the string to the expected type, and returning a default value if the conversion fails.
Syntax
Parameters
- n
- the name of the attribute
- e
- the
XElement
that may have an XAttribute
with the name - defval
- the default value to return if there's no attribute named or if the attribute value string cannot be converted to the value type
- conv
- a function from String to
Type Parameters
- T
- the value type
Return Value
either the attribute value string converted to , or else the
See Also